<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 

<h:head></h:head> 
<body>
	<h:form id="formManterAluno">		
		<p:fieldset legend="Cadastro do Aluno"  rendered="#{alunoMB.mostrar eq 'cadastrar'}" toggleable="true" toggleSpeed="500" >
			<p:panelGrid columns="2">
				<f:facet name="header">Alunos</f:facet>
				<h:outputText value="Nome" /><p:inputText id="nomeAluno" value="#{alunoMB.aluno.nome}" />
				<h:outputText value="Nome Pai" /><p:inputText id="nomePai" value="#{alunoMB.aluno.nomePai}" />
				<h:outputText value="Nome Mãe" /><p:inputText id="nomeMae" value="#{alunoMB.aluno.nomeMae}" />
				<h:outputText value="Logradouro" /><p:inputText id="logradouro" value="#{alunoMB.aluno.endereco.logradouro}" />
				<h:outputText value="Complemento" /><p:inputText id="complementoEndereco" value="#{alunoMB.aluno.endereco.complemento}" />
				<h:outputText value="Bairro" /><p:inputText id="Bairro" value="#{alunoMB.aluno.endereco.bairro}" />
				<h:outputText value="CEP" /><p:inputText id="cep" value="#{alunoMB.aluno.endereco.cep}" />
				<h:outputText value="Telefone" /><p:inputText id="telefone" value="#{alunoMB.aluno.telefone.numero}" />
			</p:panelGrid>
			<p:commandButton action="#{alunoMB.gravar()}" value="Enviar" />
		</p:fieldset>
		<p:fieldset legend="Listagem dos Alunos"  toggleable="true" toggleSpeed="500" >
			<p:dataTable value="#{alunoMB.listaDeAlunos}" var="aluno">
				<p:column>
					<f:facet name="header">Nome</f:facet>
					<h:outputText value="#{aluno.nome}" />
				</p:column>
			</p:dataTable>
		</p:fieldset>	
	</h:form>

</body> 
</html>
